//
//  MoreCell.m
//  GameBoss
//
//  Created by dllo on 15/4/21.
//  Copyright (c) 2015年 dllo. All rights reserved.
//

#import "MoreCell.h"
#define WIDTH self.contentView.frame.size.width


@implementation MoreCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.backgroundView = [[UIView alloc] init];
        [self.contentView addSubview:self.backgroundView];
        
        self.imageV = [[UIImageView alloc] init];
        [self.backgroundView addSubview:self.imageV];
        
        self.titleL = [[UILabel alloc] init];
        self.titleL.numberOfLines = 0;
        [self.titleL sizeToFit];
        [self.backgroundView addSubview:self.titleL];
        
        self.pubDateL = [[UILabel alloc] init];
        [self.backgroundView addSubview:self.pubDateL];
        
        self.cmtCountL = [[UILabel alloc] init];
        [self.backgroundView addSubview:self.cmtCountL];
        
        self.imageVS = [[UIImageView alloc] init];
        [self.backgroundView addSubview:self.imageVS];

    }
    return self;
}
- (void)layoutSubviews
{
    [super layoutSubviews];
    
    self.backgroundView.frame = CGRectMake(5 * Screen.width / 375, 1 * Screen.height / 667, self.contentView.frame.size.width - 10 * Screen.width / 375, self.contentView.frame.size.height - 2 * Screen.height / 667);
    self.backgroundView.layer.cornerRadius = 5;
    
    self.imageV.frame = CGRectMake(5 * Screen.width / 375, 5 * Screen.height / 667, WIDTH / 4 * 0.93 * Screen.width / 375, WIDTH / 4 * 0.93 * Screen.height / 667);
    self.titleL.frame = CGRectMake(WIDTH / 4 * 0.93 + 15 * Screen.width / 375, 0 * 10 * Screen.height / 667, WIDTH - WIDTH / 4 * 0.93 - 21 * Screen.width / 375, 50 * Screen.height / 667);
    self.pubDateL.frame = CGRectMake(WIDTH / 4 * 0.93 + 15 * Screen.width / 375, 60 * Screen.height / 667, WIDTH / 2, 20 * Screen.height / 667);
    self.imageVS.frame = CGRectMake(WIDTH / 4 * 3, 60 * Screen.height / 667, 30 * Screen.width / 375, 20 * Screen.height / 667);
    self.cmtCountL.frame = CGRectMake(WIDTH / 4 * 3 + 30 * Screen.width / 375, 60 * Screen.height / 667, 30 * Screen.width / 375, 20 * Screen.height / 667);
//    self.imageV.frame = CGRectMake(10, 10, 80, 70);
//    self.titleL.frame = CGRectMake(92, 10, WIDTH-72-20, 50);
//    self.pubDateL.frame = CGRectMake(92, 60,(WIDTH-72-20)/2 , 20);
//    self.imageVS.frame = CGRectMake(92+(WIDTH-72-20)/2+50, 60, 25, 20);
//    self.cmtCountL.frame = CGRectMake(92+(WIDTH-72-20)/2+50+25, 60, 30, 20);
    
}

#pragma mark 选取白黑两种模式
- (void)setNightDayModel {
    [NightManager setBackgroundColorWithView:self.contentView];
    [NightManager setViewColorWithView:self.backgroundView];
    [NightManager setLabelColorWithLabel:self.titleL];
    [NightManager setLabelColorWithLabel:self.pubDateL];
    [NightManager setLabelColorWithLabel:self.cmtCountL];
}

- (void)setLightDayModel {
    [NightManager setBackgroundColorWithView:self.contentView];
    [NightManager setViewColorWithView:self.backgroundView];
    [NightManager setLabelColorWithLabel:self.titleL];
    [NightManager setLabelColorWithLabel:self.pubDateL];
    [NightManager setLabelColorWithLabel:self.cmtCountL];
    
}

-(void)dealloc{
    [_titleL release];
    [_pubDateL release];
    [_cmtCountL release];
    [_imageV release];
    [_imageVS release];
    [super dealloc];
}

@end
